#ifndef FANCYTABWIDGET_H
#define FANCYTABWIDGET_H

#include <QTabWidget>
#include <QWidget>
#include <memory>

class QActionGroup;
class QMenu;
class QSettings;




class FancyTabWidget : public QTabWidget {
  Q_OBJECT

 public:
  FancyTabWidget(QWidget* parent = 0);
  int addTab(QWidget* page, const QIcon& icon, const QString& label);
  int insertTab(int index, QWidget* page, const QIcon& icon,
                const QString& label);
  void addBottomWidget(QWidget* widget);

  void setBackgroundPixmap(const QPixmap& pixmap);
  void addSpacer();

  void loadSettings(const QSettings&);
  void saveSettings(QSettings*);
  static const QSize TabSize_LargeSidebar;
  static const QSize IconSize_LargeSidebar;

 signals:

  void CurrentChanged(int);
 public slots:
  void setCurrentIndex(int index);
  // Mapper mapped signal needs this convenience function

 private slots:
  void tabBarUpdateGeometry();
  void currentTabChanged(int);

 protected:
  void paintEvent(QPaintEvent*);

 private:

  QPixmap background_pixmap_;
  QMenu* menu_;
  //Mode mode_;
  QWidget* bottom_widget_;
};






#endif  // FANCYTABWIDGET_H
